<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../share/taglib.jsp" %>
<html>
<head>
<title>${houseForm.method eq 'edit' ? '编辑' : '新增' }房源</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/vip.css" type="text/css">
<%@ include file="/sks/js/datePicker.inc" %>
<script type="text/javascript" src="/js/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/js/jscripts/tiny_mce/button_style/default.js"></script>
<script type="text/javascript" src="/js/jscripts/tiny_mce/button_style/simple.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init(getDefaultButtonStyle("intro,mapInfo"));
tinyMCE.init(getSimpleButtonStyle("remark"));
</script>
<html:javascript formName="houseForm"/>
<script type="text/javascript">
/*function goEdit(type) {
	var form = document.getElementById('houseForm');
	form.item('type').value = type;
	form.item('method').value = 'editUI';
	form.submit();
}
function save() {
	var bForm = document.getElementById('houseForm');
	if (validateHouseForm(bForm)) {
		bForm.submit();
	}
}
*/
function openSelectWindow() {
	 var result = window.showModalDialog("/cms/privilege/employee/list.do?isSelect=true&ts=" + new Date().getTime(), window);
	 if (null == result) {
		 return;
	 }
	 document.getElementById('employeeNameLabel').innerHTML = result;
	 document.getElementById('employeeName').value = result;
}

function deleteEmployee() {
	document.getElementById('employeeNameLabel').innerHTML = '-';
	document.getElementById('employeeName').value = '';
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<html:form styleId="houseForm" action="/cms/house.do" method="post" onsubmit="return validateHouseForm(this);">
<html:hidden property="houseId"/>
<html:hidden property="title"/>
<html:hidden property="address" value="-"/>
<html:hidden property="space" value="0"/>
<html:hidden property="type"/>
<input type="hidden" name="method" value="${houseForm.method}">
  <table width="90%" border="0" cellspacing="2" cellpadding="3" align="center">
    <tr bgcolor="#ffbe26">
    	<td colspan="2">
    		<%@ include file="houseMenu.inc"%>
    	</td>
    		
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="20%"><div align="right">房源标题：</div></td>
      <td width="80%" valign="middle">
      ${houseForm.title}
      </td>
    </tr>
    <!-- ################## 审核信息 ######################### -->
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">负责人：</div></td>
      <td>
      <table>
      	<tr>
      		<td><span style="vertical-align:middle;" id="employeeNameLabel">${houseForm.employeeName == null || houseForm.employeeName == '' ? '-' : houseForm.employeeName}</span></td>
      		<td>&nbsp;&nbsp;</td>
      		<% if (isReadOnly) { %>
      		<td>&nbsp;&nbsp;</td>
      		<td>&nbsp;&nbsp;</td>
      		<% } else { %>
      		<td><img src="/images/delete2.gif" onclick="deleteEmployee();" style="cursor:hand;" title="删除内部用户"/></td>
      		<td><img src="/images/selectBuilding.png" onclick="openSelectWindow();" style="cursor:hand;" title="选择内部用户"/></td>
      		<% } %>
      	</tr>
      </table>
      <html:hidden property="employeeName" styleId="employeeName"/>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">创建时间：</div></td>
      <td valign="middle"><fmt:formatDate value='${houseForm.createTime}' pattern='yyyy-MM-dd HH:mm:ss' /></td>
      <input type="hidden" name="createTime" value="<fmt:formatDate value='${houseForm.createTime}' pattern='yyyy-MM-dd HH:mm:ss' />"/>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">最后更新时间：</div></td>
      <td valign="middle"><fmt:formatDate value='${houseForm.lastUpdateTime}' pattern='yyyy-MM-dd HH:mm:ss' /></td>
      <input type="hidden" name="lastUpdateTime" value="<fmt:formatDate value='${houseForm.lastUpdateTime}' pattern='yyyy-MM-dd HH:mm:ss' />"/>
    </tr>
    <c:if test="${houseForm.houseStatus == 1}">
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">审核时间：</div></td>
      <td valign="middle"><fmt:formatDate value='${houseForm.auditTime}' pattern='yyyy-MM-dd HH:mm:ss' /></td>
      <input type="hidden" name="auditTime" value="<fmt:formatDate value='${houseForm.auditTime}' pattern='yyyy-MM-dd HH:mm:ss' />"/>
    </tr>
    </c:if>
    <c:if test="${houseForm.houseStatus == 2}">
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">发布时间：</div></td>
      <td valign="middle"><fmt:formatDate value='${houseForm.publishTime}' pattern='yyyy-MM-dd HH:mm:ss' /></td>
      <input type="hidden" name="publishTime" value="<fmt:formatDate value='${houseForm.publishTime}' pattern='yyyy-MM-dd HH:mm:ss' />"/>
    </tr>
    </c:if>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">房源状态：</div></td>
      <td>
      	<html:select disabled="<%=isReadOnly%>" property="houseStatus">
      		<html:option value="0"><bean:message key="info.house.status0"/></html:option>
      		<html:option value="1"><bean:message key="info.house.status1"/></html:option>
      		<html:option value="2"><bean:message key="info.house.status2"/></html:option>
      		<html:option value="3"><bean:message key="info.house.status3"/></html:option>
      		<html:option value="-1"><bean:message key="info.house.status-1"/></html:option>
      	</html:select>
      </td>
    </tr>
    <!-- ################## 审核信息 ######################### -->
    <tr bgcolor="f5f5f5"> 
      <td colspan="2"><div align="center"> 
          <button <%=isReadOnly ? "disabled='disabled'" : ""%> type="submit" class="frm_btn">保&nbsp;&nbsp;存</button>
      </div></td>
    </tr>
  </table>
</html:form>
<br>
</body>
</html>